package com.yonyou.cyxdms.sysAuth.service.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyxdms.sysAuth.service.dto.AreaManagerDto;
import com.yonyou.cyxdms.sysAuth.service.dto.user.EmpDTO;
import com.yonyou.cyxdms.sysAuth.service.dto.user.EmployeeDTO;
import com.yonyou.cyxdms.sysAuth.service.entity.EmpPo;
import com.yonyou.cyxdms.sysAuth.service.vo.employee.EmployeeAddVO;
import com.yonyou.cyxdms.sysAuth.service.vo.user.RoleUserVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 人员信息表 服务类
 * </p>
 *
 * @author zhangxianchao
 * @since 2018-09-13
 */
public interface EmpService {

    IPage<Map<String, Object>> selectPageBysql(Page page, Map<String, Object> queryCondition);

    List<Map<String, Object>> selectListBySql(Map<String, Object> queryCondition);

    Map<String, Object> getById(Long id);

    Map<String, Object> insert(EmpDTO empDTO);

    Map<String, Object> update(Long id, EmpDTO empDTO);

    void deleteById(Long id);

    void deleteBatchIds(String ids);

    /**
     * 新增dms人员信息
     *
     * @param employeeDTO
     * @return java.lang.Long
     * @author zhangsx
     * @since 2018/10/28
     */
    public Long addEmployeeFromDms(EmployeeDTO employeeDTO);

    /**
     * 更新/删除dms人员信息
     *
     * @param employeeDTO
     * @return void
     * @author zhangsx
     * @since 2018/10/28
     */
    public void updateEmployeeFromDms(EmployeeDTO employeeDTO);

    /**
     * 更新用户信息--五菱
     *
     * @author：chenzb
     * @since：2019-07-28
     */
    public void updateWlEmployeeFromDms(EmployeeDTO employeeDTO);

    Integer getEmployeeByPhone(String phone, String appId);

    /**
     * 新增emp信息
     *
     * @author：李贺
     * @since：2019-09-11
     */
    void addEmp(EmpPo empPo);

    Map<String, Map<String, String>> getEmpInfoByUserId(List<String> userIds, Boolean isContain,
                                                        String consultantId, String appId, String ownerCode);

    /**
     * 根据手机号获取顾问组织信息
     *
     * @param:
     * @return:
     * @auther: tanjie
     * @since: 2019/10/21
     */
    RoleUserVo getOrginfoByPhone(RoleUserVo roleUserVo, Integer code);

    /**
     * 通过userid查emp信息
     *
     * @auther: tanjie
     * @since: 2019/10/22
     */
    EmpDTO queryEmpInfoByUserId(Long userId);


    EmpPo getEmpInfoByOpenId(@Param("strOpenid") String strOpenid, @Param("appId") String appId);

    Integer getEmpCountByPhone(@Param("phone") String phone, @Param("appId") String appId);

    /**
     * 新增员工时校验员工身份证号
     *
     * @auther: 李贺
     * @since: 2019/11/12
     */
    EmployeeAddVO checkCertificateId(String certificateid);

    Map<Long, EmpDTO> queryEmpInfoByUserIds(List<Long> ids);

    Map<String, EmpDTO> queryEmpInfoByUserCodes(List<String> codes, String appId);

    RoleUserVo getOrgInfoByPhoneAndOwnerCode(RoleUserVo roleUserVo, Integer dcrcCommissioner);

    List<Map<String, String>> consultantVerification(List<EmployeeDTO> consultantList);

    List<Integer> getEmployeeByEmployeeName(String employeeName);

    List<EmpDTO> queryAreaManagerByOrgId(@Param("orgId") Long orgId);

    List<AreaManagerDto> queryAreaManagerAll();
}
